(function ($, tool) {
    // 设置 rem 的比例
    function SetREM(designWidth) {
        var html = document.documentElement;
        var width = html.getBoundingClientRect().width;
        html.style.fontSize = width / designWidth + 'px';//至于除数15可自行设置
        console.log('1rem=' + width / designWidth);
        //1rem= width / designWidth;
    }

    // 批量填充数据
    function fillingData(domName , data , typeName){
        var domList = document.querySelectorAll('.'+domName);
        if(typeName == 'text'){
            for(var i = 0;i< domList.length;i++){
                domList[i].innerHTML = data[i];
            }
        }
        if(typeName == 'img'){
            for(var i = 0;i< domList.length;i++){
                domList[i].setAttribute('src' , data[i]);
            }
        }
        if(typeName == 'link'){
            for(var i = 0;i< domList.length;i++){
                domList[i].setAttribute('href' , data[i]);
            }
        }
    }



    console.log(tool);
    return window.tool = {
        SetREM : SetREM,
        fillingData : fillingData,
    };
}(window, (window.tool || {})));